<?php
include "funciones.php";

if (sesion()) {
    header("Location: menu.php");
} else {
?>
<html>
    <head>
        <title>LOG-IN</title>
        <link rel="stylesheet" href="estilos/noticias.css">
    </head>
    <body>
        
        <div class="login">
            <form method="post" action="login.php">
                <table width="100%"">
                    <tr>
                        <td colspan="2" align="center" bgcolor="silver">
                            <b>LOG-IN | Toma299</b>
                        </td>
                    </tr>
                    <tr>
                        <td><b>USER</b></td>
                        <td><input type="text" name="usuario"></td>
                    </tr>
                    <tr>
                        <td><b>PASSWORD</b></td>
                        <td><input type="password" name="password"></td>
                    </tr>
                    <?php   
                        echo "<tr><td color=\"red\" align=\"center\" colspan=2>";
                        if ($_COOKIE['error'] == 1) {
                            echo "<i><font color=\"red\"> login o password incorrecto </font></i>";
                            setcookie("error", 0);                            
                        }
                        echo "</td></tr>";
                    ?>
                    <tr>
                        <td colspan="2" align="center" height="50">
                            <input class="boton" type="submit" value="ENVIAR">
                            <input class="boton" type="reset" value="BORRAR">
                        </td>
                    </tr>
                </table>
            </form>
        </div>
    </body>
</html>
<?php
}
?>